package com.xqls.biz.impl;

import com.xqls.biz.FluggasBlockAdministrationBiz;
import com.xqls.biz.FluggasTableFieldBiz;
import com.xqls.dal.model.FluggasTableField;
import com.xqls.service.FluggasTableFieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hdg on 2017/7/5.
 */
@Service
public class FluggasTableFieldBizImpl implements FluggasTableFieldBiz{
    @Autowired
    FluggasTableFieldService FluggasTableFieldService;
    @Override
    public List<String> FieldEnglish(List<String> FieldList) {
        List<String> fieldEnglish= new ArrayList<String>();
        List<FluggasTableField> tableFieldList = FluggasTableFieldService.selectBydisplayfield(FieldList);
        for (int i=0;i<tableFieldList.size();i++){
            fieldEnglish.add(tableFieldList.get(i).getTableFieldname());
        }

        return fieldEnglish;
    }

    @Override
    public List<String> FieldChinese(List<String> FieldList) {
        List<String> fieldChinese=new ArrayList<String>();
        List<FluggasTableField> tableFieldList = FluggasTableFieldService.selectBydisplayfield(FieldList);
        for (int i=0;i<tableFieldList.size();i++){
            fieldChinese.add(tableFieldList.get(i).getTableFieldAnnotations());
        }
        return fieldChinese;
    }

    @Override
    public List<FluggasTableField> selectAll() {
        return FluggasTableFieldService.selectAll();
    }

    @Override
    public boolean insert(FluggasTableField record) {
        return FluggasTableFieldService.insert(record);
    }


}
